/**
 * ...
 * @author 
 */

package ;

class BackendProxy extends haxe.remoting.AsyncProxy<BackendAPI> {}

class Flash 
{
    
    public static inline var URL = "php/index.php";
    
    public static function main () 
    {
        
        var cnx = haxe.remoting.HttpAsyncConnection.urlConnect(URL);
        cnx.setErrorHandler(function (e) { trace("onError: " + Std.string(e)); } );
        var proxy = new BackendProxy(cnx.backend);
        
        proxy.getString(function (s) trace("onGetString: " + s));
        
        proxy.hello("amore", function (s) trace("onHello: " + s));
        
        proxy.getObj( function (s) trace("onGetObj: " + Std.string(s)));
        
        proxy.getDBResult(function (s) { trace("onDBResult: " + s); } );
        
        proxy.throwEx();
        
    }
}